<template>
  <avue-form :option="option"
             v-model="form">
    <template #province-type="{item,value,label}">
      <span>{{ item }}</span>
    </template>
  </avue-form>
</template>
<script>
export default {
  data () {
    return {
      form: {
        province: '120000'
      },
      option: {
        column: [
          {
            label: '单选',
            prop: 'province',
            type: 'select',
            props: {
              label: 'name',
              value: 'code'
            },
            dicUrl: 'https://cli.avuejs.com/api/area/getProvince',
            typeformat (item, label, value) {
              return `值:${item[label]}-名:${item[value]}`
            },
            rules: [{
              required: true,
              message: '请选择省份',
              trigger: 'blur'
            }]
          }]
      }
    }
  }
}
</script>